import { NextResponse, type NextRequest } from "next/server";

export function middleware(req: NextRequest) {
  const res = NextResponse.next()
  console.log(req.nextUrl.pathname)

  if (req.nextUrl.pathname === '/demo/middleware') {
    return NextResponse.redirect(new URL('/demo/middleware/redirect', req.url))
  }

  res.headers.set("Customized", "middleware")
  return res;
}

// export const config = {
//   matcher: "/demo/middleware"
// }
